home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 171 / 171.d81 / b.spiral slide (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1998-01-01  |  9.4 KB  |  276 lines

  1. 10 poke56,56:clr:dv=peek(186):ifdv<8ordv>29thendv=8
  2. 12 poke788,49:tq=ti
  3. 14 poke53281,0:poke53280,0:print"[147]":gosub60000
  4. 20 sys57812"spiral font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  5. 22 ifti<tq+100then22
  6. 30 poke53272,31
  7. 100 gosub 1000: rem initialize
  8. 110 gosub 2000: rem instructions
  9. 120 gosub 3000: rem conditions, board
  10. 130 on m goto 140,140,180,180
  11. 140 gosub 5000: rem player move
  12. 150 if jk=1 then 7200:rem stopped
  13. 160 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
  14. 170 y=5-y: on m goto 180,140,180,110
  15. 180 gosub 6000: rem computer move
  16. 190 if jk=1 then 7200: rem stopped
  17. 200 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
  18. 210 y=5-y: on m goto 140,110,140,180
  19. 1000 dimm%(38,2),a%(3),b%(3,5),s$(5),d$(1):rem   poke808,225:poke818,32
  20. 1010 poke53371,0:fori=1to38:readm%(i,0):readm%(i,1):next
  21. 1020 data10,13,10,15,12,15,14,15,14,13,14,11,14,9,14,7,12,7,10,7,8,7,6,7,6,9
  22. 1030 data6,11,6,13,6,15,6,17,6,19,8,19,10,19,12,19,14,19,16,19,18,19,18,17
  23. 1040 data18,15,18,13,18,11,18,9,18,7,18,5,18,3,16,3,14,3,12,3,10,3,8,3,6,3
  24. 1050 b$="            [157][157][157][157][157][157][157][157][157][157][157][157]":b1$=b$+b$+b$+b$+b$+b$+b$+b$+b$
  25. 1060 fori=0to5:reads$(i):next
  26. 1070 data"[195][207][205][208][213][212][197][210] 2","[208][204][193][217][197][210]    ","[208][204][193][217][197][210] 1  ","[208][204][193][217][197][210] 2  ","[195][207][205][208][213][212][197][210]  "
  27. 1080 data"[195][207][205][208][213][212][197][210] 1"
  28. 1090 m=1:w=1:sm=1:d$(0)="[167][170][157][157][181][175]":d$(1)="[171][178][157][157][174][163]":return
  29. 2000 poke53280,0:poke53281,0:printchr$(14);chr$(8);:rem by floyd r. kirk
  30. 2010 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197][154]"
  31. 2020 print"  [217]ou determine the initial layout of"
  32. 2030 print"the board by placing several coins in a"
  33. 2040 print"series of boxes connected in a spiral,"
  34. 2050 print"one coin to a box. [193]fter the coins are"
  35. 2060 print"placed, you and the computer alternate"
  36. 2070 print"sliding any one coin toward the center,"
  37. 2080 print"up to but not on or past the next coin"
  38. 2090 print"or the center of the spiral. [212]he game"
  39. 2100 print"ends when no further moves are possible.";
  40. 2110 print"  [217]ou decide whether the one making the"
  41. 2120 print"last move wins or loses, who moves"
  42. 2130 print"first, and how many coins are set in"
  43. 2140 print"which boxes. [207]n your turn, move using"
  44. 2150 print"the left and right cursor keys, then"
  45. 2160 print"select a square; the immediate outside"
  46. 2170 print"coin will slide in to that square."
  47. 2180 print"  [195]an't beat the computer? [212]hen switch"
  48. 2190 print"sides, play against another person, or"
  49. 2200 print"watch the computer play itself."
  50. 2210 print"             [159][208]ress a key";:poke198,0
  51. 2220 geta$:ifa$=""then2220
  52. 2230 return
  53. 3000 poke53280,12:poke53281,12
  54. 3005 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197]"
  55. 3010 print"  [205]oves 1st vs. [205]oves 2nd"
  56. 3012 print" [144][185][185][185][185][185][185][185][185][185][185][185][185]  [185][185][185][185][185][185][185][185][185][185][185][185]  f1 [195]hange"
  57. 3015 print"[144][161]            [162][161]            [162]    players.";
  58. 3017 print" [144][182][182][182][182][182][182][182][182][182][182][182][182]  [182][182][182][182][182][182][182][182][182][182][182][182]"
  59. 3020 print"[196]oes the one who makes":print"the last move win or":print"lose?"
  60. 3022 printtab(7);"[144][185][185][185][185][185][185]";tab(29);"f3 [195]hange"
  61. 3025 printtab(6);"[144][161]      [162]";tab(32);"last"
  62. 3027 printtab(7);"[144][182][182][182][182][182][182]";tab(32);"move."
  63. 3030 print"[215]ho puts the coins":print"on the board?"
  64. 3032 print"    [144][185][185][185][185][185][185][185][185][185][185]";tab(29);"f5 [195]hange"
  65. 3035 print"   [144][161]"tab(14);"[162]";tab(32);"coin"
  66. 3037 print"    [144][182][182][182][182][182][182][182][182][182][182]";tab(32);"layer."
  67. 3040 printtab(29);"f7 [196]one."
  68. 3050 y=m-(m>2):r=6:c=2:gosub9000:prints$(y);""s$(5-y)
  69. 3060 r=12:c=8:gosub9000:ifw=1thenprint"[215][201][206] ":goto3070
  70. 3065 print"[204][207][211][197]"
  71. 3070 r=17:c=5:gosub9000:printleft$(s$(sm),8):poke198,0
  72. 3080 geta$:ifa$=""then3080
  73. 3090 ifa$="[135]"thensm=5-sm:goto3070
  74. 3095 ifa$="[134]"thenw=3-w:goto3060
  75. 3100 ifa$="[136]"then3120
  76. 3105 ifa$<>"[133]"then3080
  77. 3110 m=m+1:ifm=5thenm=1
  78. 3115 goto3050
  79. 3120 gosub4000:ifsm=4then3500
  80. 3121 r=5:c=27:gosub9000:print"3 coins.":printtab(27);"[208]ress [176] or [191]"
  81. 3123 printtab(27);"to move":printtab(27);"white box."
  82. 3124 printtab(27);"f7 [208]ick up":printtab(30);"or drop":printtab(30);"a coin."
  83. 3126 printtab(27);"f1 [196]one."
  84. 3128 print"";tab(27);:ifm=1thenprint"[217]ou have":goto3130
  85. 3129 print"[195]omputer has"
  86. 3130 printtab(27);"first move.":printtab(27);"[204]ast move":printtab(27);
  87. 3132 ifw=1thenprint"wins.":goto3135
  88. 3133 print"loses."
  89. 3135 cn=3:i=1:r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));""
  90. 3140 ch$="[157][136][133]":poke198,0
  91. 3150 geta$:ifa$=""thengosub9100:goto3150
  92. 3160 jl=0:forj=1to4:ifa$=mid$(ch$,j,1)thenjl=j:j=4
  93. 3170 next:ifjl=0then3150
  94. 3180 onjlgoto3200,3250,3300,3350
  95. 3200 il=i:i=i-1:ifi=0theni=38
  96. 3210 r=m%(il,0):c=m%(il,1):gosub9000:print"";d$(m%(il,2))
  97. 3220 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
  98. 3250 il=i:i=i+1:ifi=39theni=1
  99. 3260 goto3210
  100. 3300 ifcn<1andm%(i,2)=0then3150
  101. 3310 m%(i,2)=1-m%(i,2):ifm%(i,2)=0thencn=cn+1:goto3330
  102. 3320 cn=cn-1
  103. 3330 print"";tab(26);cn;"coin  [157][157]";:ifcn<>1thenprint"s";
  104. 3340 print".":r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
  105. 3350 r=5:c=27:gosub9000:printb1$;"[145]";b1$
  106. 3355 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2))
  107. 3360 hh=0:jj=38:gosub8000:ifem>0thenpoke53280,0:poke53281,0:return
  108. 3370 r=7:c=27:gosub9000:print"[212]oo simple!"
  109. 3380 printtab(27);"[212]ry again.":poke198,0
  110. 3390 forj=1to38:m%(j,2)=0:next:poke53370,0
  111. 3400 forj=1to500:geta$:ifa$<>""thenj=500
  112. 3410 next:poke53371,0:goto3120
  113. 3500 i=int(rnd(0)*2)+2
  114. 3510 j=int(rnd(0)*37)+2:ifm%(j,2)=1then3510
  115. 3520 r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(1):m%(j,2)=1:i=i-1:ifi>0then3510
  116. 3530 r=22:c=27:gosub9000:print"[204]ast move":printtab(27);
  117. 3540 ifw=1thenprint"wins.":goto3360
  118. 3550 print"loses."
  119. 3560 goto3360
  120. 4000 print"[147]"tab(30)"[158][188][172][208][201][210][193][204]"
  121. 4010 printtab(16)"[198]loyd [203]irk's  [158][177][187]"
  122. 4020 printtab(30)"[158][165][180][204][201][196][197]":print:print
  123. 4030 print"   [167][170]  [167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
  124. 4040 print"   [181][175]  [181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
  125. 4050 print"   [167][170]  [167][170]          [167][170]"
  126. 4060 print"   [181][175]  [181][175]          [181][175]"
  127. 4070 print"   [167][170]  [167][170]  [158][184][184][167][170][167][170]  [167][170]"
  128. 4080 print"   [181][175]  [181][175]  [158][184][184][181][175][181][175]  [181][175]"
  129. 4090 print"   [167][170]  [167][170]      [167][170]  [167][170]"
  130. 4100 print"   [181][175]  [181][175]      [181][175]  [181][175]"
  131. 4110 print"   [167][170]  [167][170][167][170][167][170][167][170][167][170]  [167][170]"
  132. 4120 print"   [181][175]  [181][175][181][175][181][175][181][175][181][175]  [181][175]"
  133. 4130 print"   [167][170]              [167][170]"
  134. 4140 print"   [181][175]              [181][175]"
  135. 4150 print"   [167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
  136. 4160 print"   [181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
  137. 4170 return
  138. 5000 r=5:c=27:gosub9000:print"";s$(y);"":i=1:jk=0
  139. 5002 ifm%(i,2)=1theni=i+1:goto5002
  140. 5005 print:printtab(27);:ifem=1thenprintb$:goto5020
  141. 5010 print"[154][208]ress [176][154] or [191][154]":printtab(27);"to move":printtab(27);"white box."
  142. 5020 r=11:c=27:gosub9000:print"f7[154] [211]elect":printtab(30);"square."
  143. 5022 ifm=1orm=3thenprint:printtab(27);"f2[154] [211]witch":printtab(30);"sides."
  144. 5025 printtab(27);"f6[154] [197]nd game."
  145. 5035 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":ch$="[157][136][139][137]":poke198,0
  146. 5050 geta$:ifa$=""thengosub9100:goto5050
  147. 5060 jl=0:forj=1to5:ifa$=mid$(ch$,j,1)thenjl=j:j=5
  148. 5070 next:ifjl=0then5050
  149. 5080 onjlgoto5100,5150,5200,5250,5300
  150. 5100 il=i
  151. 5110 i=i-1:ifi=0theni=hh-1
  152. 5120 ifm%(i,2)=1then5110
  153. 5130 r=m%(il,0):c=m%(il,1):gosub9000:print"";d$(m%(il,2))
  154. 5140 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto5050
  155. 5150 il=i
  156. 5160 i=i+1:ifi=hhtheni=1
  157. 5170 ifm%(i,2)=1then5160
  158. 5180 goto5130
  159. 5200 r=7:c=27:gosub9000:printb1$;b$;b$;b$
  160. 5210 m%(i,2)=1:j=i+1
  161. 5220 ifm%(j,2)=0thenj=j+1:goto5220
  162. 5230 m%(j,2)=0:r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(0)
  163. 5235 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(1)
  164. 5240 return
  165. 5250 jk=1:goto5310
  166. 5300 ifm=2then5050
  167. 5310 r=7:c=27:gosub9000:printb1$;b$;b$;b$
  168. 5321 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2)):goto5240
  169. 6000 r=5:c=27:gosub9000:print"";s$(y);"":jk=0
  170. 6005 printtab(27);"[212]hinking...":ifm=4thenprinttab(27);"f6[154] [197]nd game."
  171. 6010 gosub8100:c2=0:forj=1to n:ifa%(j)=0thenc2=c2+1
  172. 6020 next:ifc2=nthen6300
  173. 6030 c2=0:c1=0:forj=1to n:ifa%(j)=1thenc1=c1+1:goto6040
  174. 6035 ifa%(j)>1thenc2=c2+1:k=j
  175. 6040 next:ifc2>1thengosub8100:goto6150
  176. 6045 ifc2=0then6100
  177. 6050 c2=0:forj=hhto2step-1:ifm%(j,2)=0then6070
  178. 6055 c2=c2+1:if2*k-1>c2then6070
  179. 6060 m%(j,2)=0:x=j:gosub8300:r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(0):i=j:j=2
  180. 6070 next
  181. 6080 ifw<>1then6090
  182. 6082 c2=i-a%(k)-(c1/2<>int(c1/2)):m%(c2,2)=1
  183. 6084 r=m%(c2,0):c=m%(c2,1):gosub9000:print"";d$(1):x=c2:gosub8300:goto6340
  184. 6090 c2=i-a%(k)-(c1/2=int(c1/2)):m%(c2,2)=1
  185. 6095 r=m%(c2,0):c=m%(c2,1):gosub9000:print"";d$(1):x=c2:gosub8300:goto6340
  186. 6100 forj=hhto2step-1:ifm%(j,2)=0orm%(j-1,2)=1then6120
  187. 6110 m%(j,2)=0:x=j:gosub8300:r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(0)
  188. 6112 m%(j-1,2)=1:r=m%(j-1,0):c=m%(j-1,1):gosub9000:print"";d$(1)
  189. 6115 x=j-1:gosub8300:j=2
  190. 6120 next:goto6340
  191. 6150 fori=1to n:e=a%(i):forj=0to5:f=e/2:b%(i,j)=2*(f-int(f)):e=int(f):next:next
  192. 6160 jl=0:forj=5to0step-1:c2=0:h=0:fori=1to n:ifb%(i,j)=0then6190
  193. 6170 c2=c2+1:ifa%(i)<=hthen6190
  194. 6180 h=a%(i):g=i
  195. 6190 next
  196. 6200 ifc2/2<>int(c2/2)thenjl=1:j=0
  197. 6210 next:ifjl=0then6300
  198. 6220 d=a%(g):a%(g)=0:forj=0to5:b%(g,j)=0:c2=0:fori=1to n:ifb%(i,j)=1thenc2=c2+1
  199. 6230 next:a%(g)=a%(g)+2*(c2/2-int(c2/2))*2^j:next
  200. 6240 c2=0:forj=hhto2step-1:ifm%(j,2)=0then6270
  201. 6250 c2=c2+1:if2*g-1>c2then6270
  202. 6260 m%(j,2)=0:x=j:gosub8300:r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(0):i=j:j=2
  203. 6270 next
  204. 6280 x=i-d+a%(g):m%(x,2)=1:r=m%(x,0):c=m%(x,1):gosub9000:print"";d$(1)
  205. 6290 gosub8300:goto6340
  206. 6300 forj=1tohh-1:ifm%(j,2)=1orm%(j+1,2)=0then6330
  207. 6310 m%(j+1,2)=0:x=j+1:gosub8300:r=m%(j+1,0):c=m%(j+1,1):gosub9000:print"";d$(0)
  208. 6315 m%(j,2)=1:r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(1)
  209. 6320 x=j:gosub8300:j=hh-1
  210. 6330 next
  211. 6340 ifm=4thengeta$:ifa$="[139]"thenjk=1
  212. 6350 poke198,0:return
  213. 7000 r=7:c=27:gosub9000:print"[215][201][206][211]!      "
  214. 7010 forj=0to320:poke53280,j and15:next:goto7300
  215. 7100 r=7:c=27:gosub9000:print"[204][207][211][197][211]      "
  216. 7110 fork=1to35:forj=0to15:poke53270,j:next:next:poke53270,200:goto7300
  217. 7200 r=7:c=27:gosub9000:print"[154][199][193][205][197] [197][206][196][197][196]"
  218. 7210 r=22:c=27:gosub9000:printb$;b$;
  219. 7300 r=11:c=27:gosub9000:print"f7[154] [206]ew game"
  220. 7310 printtab(27);"f6[154] [209]uit":poke198,0
  221. 7320 geta$:ifa$=""thengosub9100:goto7320
  222. 7330 ifa$="[136]"thenfori=1tohh:m%(i,2)=0:next:goto120
  223. 7340 ifa$<>"[139]"then7320
  224. 7350 printchr$(9);"[147]":poke808,237:poke818,237:goto40000
  225. 8000 em=0:forj=jjto1step-1:ifm%(j,2)=1thenhh=j:j=1
  226. 8010 next:ifhh<2then8040
  227. 8020 forj=1tohh:ifm%(j,2)=0thenem=em+1
  228. 8030 next
  229. 8040 ifem=0thenr=22:c=27:gosub9000:printb$;b$;
  230. 8050 return
  231. 8100 n=0:js=hh
  232. 8110 jm=0:forj=js to2step-1:ifm%(j,2)=0then8150
  233. 8120 fork=j-1to1step-1:ifm%(k,2)=0then8140
  234. 8130 n=n+1:a%(n)=j-k-1:js=k-1:k=1:j=2:jm=1
  235. 8140 next:ifjm=0thenn=n+1:a%(n)=j-1:j=2
  236. 8150 next
  237. 8160 ifjm=1andjs>1then8110
  238. 8170 return
  239. 8300 poke53370,0:r=m%(x,0):c=m%(x,1):gosub9000:forj1=1to4:print"";d$(1);
  240. 8310 print"[145][157][157]";:forj2=1to100:next:print"";d$(m%(x,2));"[145][157][157]";
  241. 8320 forj2=1to100:next
  242. 8330 next:print"";d$(m%(x,2)):poke53371,0:return
  243. 9000 poke781,r:poke782,c:poke783,0:sys65520:return
  244. 9100 poke53370,0:poke1435,126:fori3=1to45:next
  245. 9110 poke1435,120
  246. 9120 poke1436,126:fori3=1to40:next
  247. 9130 poke1436,120
  248. 9140 poke1476,126:fori3=1to35:next
  249. 9150 poke1476,120
  250. 9160 poke1475,126:fori3=1to30:next
  251. 9170 poke1475,120
  252. 9180 poke53371,0:return
  253. 10000 a$="0:b.spiral slide":dv=peek(186):ifdv<8ordv>29thendv=8
  254. 10010 open15,dv,15,"s"+a$:close15:savea$,dv:end
  255. 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
  256. 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
  257. 40020 print"[147]":poke53272,23:poke186,8:poke2048,0:poke44,8:poke43,1:end
  258. 40030 forj=8to29:i=peek(820+j):ifi=14thennext
  259. 40040 close2:open2,i,2:close2:ifstthen40060
  260. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  261. 40060 next:return
  262. 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  263. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  264. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  265. 60000 print"[147]":z$=" [152]                                      ":poke214,10:print
  266. 60010 print" [155][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]":fori=0to11:printz$:next
  267. 60020 print" [151][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][152]"
  268. 60030 z$(0)="[211] [208] [201] [210] [193] [204]   [211] [204] [201] [196] [197]
  269. 60040 z$(2)[178]"by ascloyd (NULL). (NULL)irk
  270. 60050 z$(4)="(c) 1998 by [202] & [198] [208]ublishing, [201]nc."
  271. 60060 z$(6)="[212]his program is not shareware
  272. 60070 z$(7)[178]"or in the public domain."
  273. 60080 z$(9)[178]"1-800-594-3370 or 1-318-221-8718
  274. 60090 poke214,12:print:fori=0to9:printtab(20-(len(z$(i))/2))""z$(i):next:return
  275. 60100 fori=0to6:printtab(20-(len(z$(i))/2))""z$(i):next:return
  276.